<?php

class CalendarSyncLogEntry {
    
    public $summary; //the meeting summary/subject
    public $startDateTime; //the timestamp of the start of the meeting
    public $goog_event_id; //The ID of the event in Google Calendar
    public $sfdc_event_id; //The ID of the event in Salesforce Calendar
    public $Action_Type; //What sort of action was performed on event. 
    public function __construct() {
        
    }
    
    public function encodeJSON() 
    { 
        foreach ($this as $key => $value) 
        { 
            $json->$key = $value; 
        } 
        return json_encode($json); 
    } 
    
    public function decodeJSON($json_str) 
    { 
        $json = json_decode($json_str, 1); 
        foreach ($json as $key => $value) 
        { 
            $this->$key = $value; 
        } 
    } 
    
    public static function createEntry($userId, $operationStartTimestamp, $email, $operation, $details, $result) {
        $entry = new ContactSyncLogEntry();
        $entry->details = $details;
        $entry->email = $email;
        $entry->operation = $operation;
        $entry->result = $result;
        $entry->startDateTime = $operationStartTimestamp;
        return $entry;
    }
}

?>
